package com.java.action;

import java.util.ArrayList;
import java.util.List;

import com.java.pojo.ComEmp;

public class EmpResultAction {
	
	private List<ComEmp> list= new ArrayList<ComEmp>();
	private List<ComEmp>list1 ;
	private int page=1;
	private int totalPages;
	private int rowCount;
	
	public String execute(){
		
		int start = (page-1)*5;
		System.out.println(list.size());
		list1 = new ArrayList<ComEmp>();
		int end =start+5>rowCount? rowCount:start+5;
		
		for(int i=start;i<end;i++){
			
			
			list1.add(list.get(i));
		}
		System.out.println(list1.size());
		return "success";
	}
	
	public int getRowCount() {
		return rowCount;
	}

	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
	}

	public List<ComEmp> getList1() {
		return list1;
	}

	public void setList(List<ComEmp> list) {
		this.list = list;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getTotalPages() {
		return totalPages;
	}

	
	
	public List<ComEmp> getList() {
		return list;
	}


	public void setList1(List<ComEmp> list1) {
		this.list1 = list1;
	}


	

}
